package error

import (
	"math"
)

func countPairs(deliciousness []int) (ans int) {
	for i := 0; i < len(deliciousness); i++ {
		for j := i + 1; j < len(deliciousness); j++ {
			num := deliciousness[i] + deliciousness[j]
			log2 := math.Log2(float64(num))
			if log2 >= 0 && log2 == math.Trunc(log2) {
				ans++
			}
		}
	}
	return ans % (1e9 + 7)
}
